<?php
include("helper/DBOperation.php");
echo "\n\nCron Start at ==".date('d-m-Y H:i')."==";
$dbObj = new DBOperation();
$date = strtotime("-1 day");
$date = date('Y-m-d H:i:s',$date);

$sql = mysql_query("delete from tbl_component_state where last_ping < DATE('".$date."') ");
$sql = mysql_query("delete from tbl_component_cpu where last_ping < DATE('".$date."') ");
$sql = mysql_query("delete from tbl_component_hvac where last_ping < DATE('".$date."') ");
$sql = mysql_query("delete from tbl_component_display where last_ping < DATE('".$date."') ");
$sql = mysql_query("delete from tbl_log_message where created_date < DATE('".$date."') ");

echo "\n\nCron end at ==".date('d-m-Y H:i')."==";
?>
